package com.zx.idc.backend.gui.report.roperationlog;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zx.idc.backend.gui.common.BaseApi;
import com.zx.idc.backend.gui.common.Result;
import com.zx.idc.ds.report.roperationlog.entity.ROperationLogMon;
import com.zx.idc.ds.report.roperationlog.service.IROperationLogMonService;
import com.zx.idc.ds.report.roperationlog.vo.ROperationLogMonVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 操作日志统计表-月报 前端控制器
 * </p>
 *
 * @author rxliuli
 * @since 2019-01-31
 */
@RestController
@RequestMapping("/api/rOperationLogMon")
public class ROperationLogMonController extends BaseApi {

    @Autowired
    private IROperationLogMonService irOperationLogMonService;

    @GetMapping("/report")
    public Result<List<ROperationLogMon>> report(ROperationLogMonVo rOperationLogMonVo) {
        LocalDate dateNow = rOperationLogMonVo.getDateNow();
        return success(irOperationLogMonService.selectList(
            new EntityWrapper<ROperationLogMon>()
                .eq("belongYear", dateNow.getYear())
        ));
    }
}

